this.BX=this.BX||{};(function(r,n,e){"use strict";var t="/bitrix/js/main/imageeditor/external/photoeditorsdk/assets";var a="/bitrix/images/landing/imageeditor/assets";function i(r){if(r.includes("sites_recommended_transform_default")){var n=r.split("sites_recommended_transform_default"),e=babelHelpers.slicedToArray(n,2),i=e[1];return"".concat(t,"/ui/desktop/editor/controls/transform/ratios/imgly_transform_common_4-3").concat(i)}if(r.includes("sites_recommended_transform_retina")){var s=r.split("sites_recommended_transform_retina"),o=babelHelpers.slicedToArray(s,2),d=o[1];return"".concat(t,"/ui/desktop/editor/controls/transform/ratios/imgly_transform_common_4-3").concat(d)}if(r.includes("landing-transform-3-4")){var l=r.split("landing-transform-3-4"),m=babelHelpers.slicedToArray(l,2),f=m[1];return"".concat(a,"/transform/ratios/landing-transform-3-4").concat(f)}if(r.includes("landing-transform-4-3")){var c=r.split("landing-transform-4-3"),g=babelHelpers.slicedToArray(c,2),u=g[1];return"".concat(a,"/transform/ratios/landing-transform-4-3").concat(u)}if(r.includes("landing-transform-9-16")){var _=r.split("landing-transform-9-16"),p=babelHelpers.slicedToArray(_,2),h=p[1];return"".concat(a,"/transform/ratios/landing-transform-9-16").concat(h)}if(r.includes("landing-transform-16-9")){var b=r.split("landing-transform-16-9"),v=babelHelpers.slicedToArray(b,2),T=v[1];return"".concat(a,"/transform/ratios/landing-transform-16-9").concat(T)}if(r.includes("landing-transform-1-1")){var A=r.split("landing-transform-1-1"),I=babelHelpers.slicedToArray(A,2),N=I[1];return"".concat(a,"/transform/ratios/landing-transform-1-1").concat(N)}if(r.includes("landing-transform-custom")){var y=r.split("landing-transform-custom"),E=babelHelpers.slicedToArray(y,2),M=E[1];return"".concat(a,"/transform/ratios/landing-transform-custom").concat(M)}return r}function s(r){var n=BX.util.getExtension(r);return"image/".concat(n==="jpg"?"jpeg":n)}var o="/bitrix/tools/landing/proxy.php";var d=function r(){var n=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},t=n.width,a=n.height;return e.Type.isNumber(t)&&e.Type.isNumber(a)};function l(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},n=r.image,t=r.dimensions;var a={width:t.width||t.maxWidth||t.minWidth,height:t.height||t.maxHeight||t.minHeight};return{image:n,megapixels:100,proxy:o,defaultControl:"transform",assets:{resolver:i},export:{format:s(n),type:BX.Main.ImageEditor.renderType.BLOB,quality:1},controlsOptions:{transform:{categories:[{identifier:"sites_recommended",defaultName:e.Loc.getMessage("LANDING_IMAGE_EDITOR_RECOMMENDED_RATIOS"),ratios:[{identifier:"sites_recommended_transform_retina",defaultName:e.Loc.getMessage("LANDING_IMAGE_EDITOR_TRANSFORM_DEFAULT"),ratio:function(){if(d(a)){return a.width/a.height}return undefined}()},{identifier:"landing-transform-custom",defaultName:e.Loc.getMessage("IMAGE_EDITOR_RATIOS_CUSTOM"),ratio:"*"}]},{identifier:"sites_other",defaultName:e.Loc.getMessage("LANDING_IMAGE_EDITOR_OTHER_RATIOS"),ratios:[{identifier:"landing-transform-1-1",defaultName:"1:1",ratio:1},{identifier:"landing-transform-3-4",defaultName:"3:4",ratio:3/4},{identifier:"landing-transform-4-3",defaultName:"4:3",ratio:4/3},{identifier:"landing-transform-9-16",defaultName:"9:16",ratio:9/16},{identifier:"landing-transform-16-9",defaultName:"16:9",ratio:16/9}]}],replaceCategories:false,availableRatios:["sites_recommended_transform_default","sites_recommended_transform_retina","landing-transform-3-4","landing-transform-4-3","landing-transform-9-16","landing-transform-16-9","landing-transform-1-1","landing-transform-custom"]}}}}function m(r){return r.split("\\").pop().split("/").pop()}var f=function(){function r(){babelHelpers.classCallCheck(this,r)}babelHelpers.createClass(r,null,[{key:"edit",value:function r(n){var e=BX.Main.ImageEditor.getInstance();var t=l(n);return e.edit(t).then(function(r){r.name=decodeURIComponent(m(n.image));return r})}}]);return r}();r.ImageEditor=f})(this.BX.Landing=this.BX.Landing||{},BX.Main,BX);
//# sourceMappingURL=imageeditor.bundle.map.js